﻿$(document).ready(function () {

	// Alphabet

	$('.but.eng, .word.num, .word.rus').hide();

	$('.but.eng').click(function () {

		$('.word.rus').stop().hide('fast');

		$('.word.num, .but.eng').hide();

		$('.word.eng').stop(true, true).show('slow');

		$('.but.rus').stop(true, true).show();

	});

	$('.but.rus').click(function () {

		$('.word.eng').stop().hide('fast');

		$('.word.num, .but.rus').hide();

		$('.word.rus').stop(true, true).show('slow');

		$('.but.eng').stop(true, true).show();

	});

	$('.but.num').click(function () {

		$('.word.rus, .word.eng').hide('fast');

		$('.word.num').show('slow');

	});



	// Slider

	$("#showcase").awShowcase({

		content_width:			558,

		content_height:			198,

		auto:					true,

		interval:				3000,

		continuous:				true,

		loading:				true,

		arrows:					true,

		buttons:				false,

		btn_numbers:			false,

		keybord_keys:			true,

		mousetrace:				false,

		pauseonover:			true,

		stoponclick:			false

	});



	// Slide Poster
	var sla = $('.poster-min li').length;
	if( sla < 1) {
		$('.bx-wrapper').hide();
	}
	$('.poster-min').bxSlider({

		minSlides: 1,

		maxSlides: 3,

		slideWidth: 106,

		slideMargin: 6

	});

		var imgs = $('.poster-min img').eq(0).attr('src');

	

	$('.poster-min img').click(function() {

		$('.general').find('img').attr('src', $(this).attr('src'));

	});

	$('.poster-min li').eq(0).addClass('active');

	$('.poster-min li').click(function() {

		$('.poster-min li').removeClass('active');

		$(this).addClass('active');

	});



	// Tab box

	$('.tab-nav').delegate('li:not(.cur)', 'click', function() {

		$(this).addClass('cur').siblings().removeClass('cur').parents().find('.tab-box').hide().removeClass('cur').eq($(this).index()).addClass('cur').fadeIn(500);

	});



	// Order

	$('.order-view input:radio').bind('change', 'click', function() {

		var height = $('body').height()*2;

		$('html, body').animate({scrollTop: height});

		$('input[name="type_curr"]').val($(this).attr('value'));

	});



	// Copyright

	$('body').after('<!--\nДизайн был разработан сервисом Lequeshop\nАдрес сервиса: http://Lequeshop.ru.ru/\nСайт управляется системой Lequeshop.ru\n-->');

});



// WS Slider v1.0

(function(jQuery){jQuery.fn.awShowcase=function(options){var defaults={content_width:700,content_height:470,fit_to_parent:false,auto:false,interval:3000,continuous:false,loading:true,tooltip_width:200,tooltip_icon_width:32,tooltip_icon_height:32,tooltip_offsetx:18,tooltip_offsety:0,arrows:true,buttons:true,btn_numbers:false,keybord_keys:false,mousetrace:false,pauseonover:true,stoponclick:true,transition:'hslide',transition_delay:300,transition_speed:500,show_caption:'onload',thumbnails:false,thumbnails_position:'outside-last',thumbnails_direction:'vertical',thumbnails_slidex:0,dynamic_height:false,speed_change:false,viewline:false,fullscreen_width_x:15,custom_function:null};options=jQuery.extend(defaults,options);var current_id=0;var previous_id=0;var break_loop=false;var pause_loop=false;var myInterval=null;var showcase=jQuery(this);var showcase_width=options.content_width;var animating=false;var content_viewline_width=10000;var animation_distance=0;var old_animation_distance=0;var remaining_width=0;var content_container=jQuery(document.createElement('div')).css('overflow','hidden').css('position','relative').addClass('showcase-content-container').prependTo(showcase);if(options.fit_to_parent){showcase_width=jQuery(showcase).width()+options.fullscreen_width_x}if(options.viewline){options.thumbnails=false;options.dynamic_height=false;content_container.css('width',content_viewline_width);showcase.css('overflow','hidden');$('.showcase-arrow-previous').hide()}var contentArray=[];var thumbnailArray=[];var content_count=0;showcase.children('.showcase-slide').each(function(){var object=jQuery(this);content_count++;if(options.thumbnails){var thumb=object.find('.showcase-thumbnail');thumbnailArray.push(thumb);thumb.remove()}var object_width=object.find('.showcase-content').children().width();var object_height=object.find('.showcase-content').children().height();contentArray.push(object.html());object.remove();var new_object=getContent(content_count-1);if(options.viewline||content_count===1){content_container.append(new_object)}if(options.viewline){new_object.css('position','relative');new_object.css('float','left');new_object.css('width',object_width)}if(options.dynamic_height){new_object.css('height',object_height);if(content_count===1){content_container.css('height',object_height)}}else{new_object.css('height',options.content_height);if(content_count===1){content_container.css('height',options.content_height)}}if(options.viewline||content_count===1){displayAnchors(new_object);displayCaption(new_object);if(options.show_caption==='show'){jQuery(new_object).find('.showcase-caption').show()}}});var thumb_wrapper;var thumbnailStretch=0;var thumbnailsPerPage=0;if(options.thumbnails){thumb_container=jQuery('<div />');thumb_restriction=jQuery('<div />');thumb_wrapper=jQuery('<div />');for(i=thumbnailArray.length-1;i>=0;--i){var thumbnail=jQuery(thumbnailArray[i]).css({'overflow':'hidden'});thumbnail.attr('id','showcase-thumbnail-'+i);thumbnail.addClass((i===0)?'active':'');thumbnail.click(function(a,b){return function(){if(myInterval){pause_loop=true;clearInterval(myInterval)}changeContent(a,b)}}(i,''));thumb_wrapper.prepend(thumbnail)}if(options.thumbnails_position==='outside-first'||options.thumbnails_position==='outside-last'){if(options.thumbnails_direction!=='horizontal'){content_container.css('float','left');content_container.css('width',options.content_width);thumb_container.css('float','left');thumb_container.css('height',options.content_height)}else{jQuery(thumb_wrapper).find('.showcase-thumbnail').css('float','left')}if(options.thumbnails_position==='outside-last'){showcase.append(thumb_container);if(options.thumbnails_direction!=='horizontal'){showcase.append(jQuery('<div />').addClass('clear'))}}else{showcase.prepend(thumb_container);if(options.thumbnails_direction!=='horizontal'){showcase.append(jQuery('<div />').addClass('clear'))}}}else{thumb_container.css({'position':'absolute','z-index':20});if(options.thumbnails_direction==='horizontal'){thumb_container.css({'left':0,'right':0});jQuery(thumb_wrapper).find('.showcase-thumbnail').css('float','left');jQuery(thumb_wrapper).append(jQuery('<div />').addClass('clear'));if(options.thumbnails_position==='inside-first'){thumb_container.css('top',0)}else{thumb_container.css('bottom',0)}}else{thumb_container.css({'top':0,'bottom':0});if(options.thumbnails_position==='inside-first'){thumb_container.css('left',0)}else{thumb_container.css('right',0)}}content_container.prepend(thumb_container)}thumb_container.addClass('showcase-thumbnail-container');thumb_container.css('overflow','hidden');thumb_restriction.addClass('showcase-thumbnail-restriction');thumb_restriction.css({'overflow':'hidden','position':'relative'});if(options.thumbnails_direction==='horizontal'){thumb_restriction.css({'float':'left'})}thumb_wrapper.addClass('showcase-thumbnail-wrapper');if(options.thumbnails_direction==='horizontal'){thumb_wrapper.addClass('showcase-thumbnail-wrapper-horizontal')}else{thumb_wrapper.addClass('showcase-thumbnail-wrapper-vertical')}thumb_wrapper.css('position','relative');thumb_restriction.append(thumb_wrapper);thumb_container.append(thumb_restriction);var buttonBackward=jQuery('<div class="showcase-thumbnail-button-backward" />');if(options.thumbnails_direction!=='horizontal'){buttonBackward.html('<span class="showcase-thumbnail-vertical"><span>Up</span></span>')}else{buttonBackward.css({'float':'left'});buttonBackward.html('<span class="showcase-thumbnail-horizontal"><span>Left</span></span>')}buttonBackward.click(function(){slideThumbnailWrapper('backward',false,true)});thumb_container.prepend(buttonBackward);var buttonForward=jQuery('<div class="showcase-thumbnail-button-forward" />');if(options.thumbnails_direction!=='horizontal'){buttonForward.html('<span class="showcase-thumbnail-vertical"><span>Down</span></span>')}else{buttonForward.css({'float':'left'});buttonForward.html('<span class="showcase-thumbnail-horizontal"><span>Right</span></span>')}buttonForward.click(function(){slideThumbnailWrapper('forward',false,true)});thumb_container.append(buttonForward);var thumbnailVisibleStretch=0;if(options.thumbnails_direction!=='horizontal'){thumbnailVisibleStretch=getElementHeight(thumb_wrapper,false);thumbnailVisibleStretch+=(getElementHeight(buttonBackward))+(getElementHeight(buttonForward));while(thumbnailVisibleStretch<options.content_height){thumbnailVisibleStretch+=getElementHeight(jQuery(thumbnailArray[0]));thumbnailsPerPage++}}else{thumbnailVisibleStretch=getElementWidth(thumb_wrapper,false);thumbnailVisibleStretch+=(getElementWidth(buttonBackward))+(getElementWidth(buttonForward));while(thumbnailVisibleStretch<showcase_width){thumbnailVisibleStretch+=getElementWidth(jQuery(thumbnailArray[0]));thumbnailsPerPage++}}if(thumbnailsPerPage+1>thumbnailArray.length){if(options.thumbnails_direction!=='horizontal'){thumb_restriction.css('margin-top',getElementHeight(buttonBackward))}else{thumb_restriction.css('margin-left',getElementWidth(buttonBackward))}buttonBackward.hide();buttonForward.hide()}if(options.thumbnails_direction!=='horizontal'){var buttonsHeight=(getElementHeight(buttonBackward))+(getElementHeight(buttonForward));thumb_restriction.css('height',options.content_height-buttonsHeight)}else{var buttonsWidth=(getElementWidth(buttonBackward))+(getElementWidth(buttonForward));thumb_restriction.css('width',showcase_width-buttonsWidth)}if(options.thumbnails_direction==='horizontal'){jQuery('.showcase-thumbnail').each(function(){thumbnailStretch+=getElementWidth(jQuery(this))});thumb_wrapper.css('width',thumbnailStretch)}else{jQuery('.showcase-thumbnail').each(function(){thumbnailStretch+=getElementHeight(jQuery(this))})}}if(options.thumbnails&&options.thumbnails_position.indexOf("outside")!==-1&&options.thumbnails_direction!=='horizontal'&&!options.viewline){showcase.css('width',showcase_width+getElementWidth(thumb_wrapper,true,false))}else if(!options.fit_to_parent){showcase.css('width',showcase_width)}if(content_count>1&&options.auto){myInterval=window.setInterval(autoChange,options.interval)}if(options.auto&&options.pauseonover){showcase.mouseenter(function(){break_loop=true;clearInterval(myInterval)});showcase.mouseleave(function(){if(!pause_loop){break_loop=false;myInterval=window.setInterval(autoChange,options.interval)}})}if(options.arrows&&content_count>1){jQuery(document.createElement('div')).addClass('showcase-arrow-previous').prependTo(showcase).click(function(){if(myInterval){if(options.stoponclick){pause_loop=true}clearInterval(myInterval)}changeContent((current_id===0)?content_count-1:parseInt(current_id)-1,'previous')});jQuery(document.createElement('div')).addClass('showcase-arrow-next').prependTo(showcase).click(function(){if(myInterval){if(options.stoponclick){pause_loop=true}clearInterval(myInterval)}changeContent(current_id+1,'next')});if(options.viewline){$('.showcase-arrow-previous').hide()}}if(options.buttons&&content_count>1){jQuery(document.createElement('div')).css('clear','both').addClass('showcase-button-wrapper').appendTo(showcase);i=0;while(i<content_count){jQuery(document.createElement('span')).attr('id','showcase-navigation-button-'+i).addClass((i===0)?'active':'').html((options.btn_numbers)?parseInt(i)+1:'&#9679;').click(function(a,b){return function(){if(myInterval){if(options.stoponclick){pause_loop=true}clearInterval(myInterval)}changeContent(a,b)}}(i,'')).appendTo(jQuery(showcase).find('.showcase-button-wrapper'));i++}}if(options.keybord_keys){jQuery(document).keydown(function(e){if(options.stoponclick){pause_loop=true}if(myInterval)clearInterval(myInterval);if(e.keyCode===37){changeContent((current_id===0)?content_count-1:parseInt(current_id)-1,'previous')}if(e.keyCode===39){changeContent((current_id===content_count-1)?0:parseInt(current_id)+1,'next')}})}function getContent(id){var new_content=jQuery(document.createElement('div')).attr('id','showcase-content-'+id).css('overflow','hidden').css('position','absolute').addClass('showcase-content').html(contentArray[id]);if(!options.viewline){new_content.css('width',options.content_width)}if(options.fit_to_parent&&!options.viewline){new_content.css('left',(showcase_width/2)-options.content_width/2)}return new_content}function autoChange(){var nextID=parseInt(current_id)+1;if(nextID===content_count&&options.continuous){nextID=0}else if(nextID===content_count&&!options.continuous){break_loop=true;clearInterval(myInterval)}if(!break_loop){changeContent(nextID,'next')}}function changeContent(id,direction){if(current_id!==id&&!animating){var obj;var obj2;var delay=0;var i;var lrpos=(options.fit_to_parent)?(showcase_width/2)-(options.content_width/2):0;if((id>current_id&&direction!=='previous')||direction==='next'){if(options.viewline){if(current_id<content_count-1){if(!options.speed_change){animating=true}updateContentViewlineWidth();if(options.pauseonover){window.clearInterval(myInterval)}remaining_width=0;for(i=current_id+1,len=content_count;i<len;++i){obj=addedContentArray[i];remaining_width+=obj.find('.showcase-content').children().width()}if(remaining_width>showcase_width){old_animation_distance=animation_distance;animation_distance-=addedContentArray[current_id].find('.showcase-content').children().width()}else if($('.showcase-arrow-next').is(':visible')){old_animation_distance=animation_distance;animation_distance=-(content_viewline_width-(remaining_width+(showcase_width-remaining_width)));$('.showcase-arrow-next').fadeOut(300)}content_container.animate({left:animation_distance+'px'},options.transition_speed,function(){animating=false});if($('.showcase-arrow-next').is(':visible')){current_id++}$('.showcase-arrow-previous').fadeIn(300)}}else{if(!options.speed_change){animating=true}obj=jQuery(showcase).find('#showcase-content-'+parseInt(current_id));obj2=getContent(id);content_container.append(obj2);if(options.dynamic_height){obj2.css('height',obj2.find('.showcase-content').children().height())}else{obj2.css('height',options.content_height)}if(obj.find('.showcase-content').children().height()>obj2.find('.showcase-content').children().height()&&options.dynamic_height){content_container.stop(true,true).animate({height:obj2.find('.showcase-content').children().height()},200);delay=100}if(options.transition==='hslide'){jQuery(obj).delay(delay).animate({left:-(options.content_width)},options.transition_speed+options.transition_delay,function(){obj.remove()})}else if(options.transition==='vslide'){jQuery(obj).delay(delay).animate({top:-(options.content_height)},options.transition_speed+options.transition_delay,function(){obj.remove()})}else{jQuery(obj).delay(delay).fadeOut(options.transition_speed,function(){obj.remove()})}displayAnchors(obj,true);displayCaption(obj,true);if(options.transition==='hslide'){obj2.css('left',showcase_width);jQuery(obj2).delay(delay).animate({left:lrpos},options.transition_speed,function(){displayAnchors(obj2);displayCaption(obj2);afterAnimation(obj2)})}else if(options.transition==='vslide'){obj2.css('top',showcase.height());jQuery(obj2).delay(delay).animate({top:'0px'},options.transition_speed,function(){displayAnchors(obj2);displayCaption(obj2);afterAnimation(obj2)})}else{obj2.css('left',lrpos);obj2.css('display','none');jQuery(obj2).delay(delay).fadeIn(options.transition_speed,function(){displayAnchors(obj2);displayCaption(obj2);afterAnimation(obj2)})}}}else if(id<current_id||direction==='previous'){if(options.viewline){if(current_id!==0){if(!options.speed_change){animating=true}updateContentViewlineWidth();if(options.pauseonover){window.clearInterval(myInterval)}content_container.animate({left:old_animation_distance+'px'},options.transition_speed,function(){animating=false});animation_distance=old_animation_distance;current_id--;if(current_id===0){$('.showcase-arrow-previous').fadeOut(300)}old_id=current_id-1;sub_width=jQuery(addedContentArray[old_id]).width();old_animation_distance=old_animation_distance+sub_width}$('.showcase-arrow-next').fadeIn(300)}else{if(!options.speed_change){animating=true}obj=jQuery(showcase).find('#showcase-content-'+parseInt(current_id));obj2=getContent(id);content_container.append(obj2);if(options.dynamic_height){obj2.css('height',obj2.find('.showcase-content').children().height())}else{obj2.css('height',options.content_height)}if(obj.find('.showcase-content').children().height()>obj2.find('.showcase-content').children().height()&&options.dynamic_height){content_container.stop(true,true).animate({height:obj2.find('.showcase-content').children().height()},200);delay=100}if(options.transition==='hslide'){jQuery(obj).delay(delay).animate({left:(showcase_width)+'px'},options.transition_speed+options.transition_delay,function(){displayAnchors(obj,true);displayCaption(obj,true);obj.remove()})}else if(options.transition==='vslide'){jQuery(obj).delay(delay).animate({top:(options.content_height)+'px'},options.transition_speed+options.transition_delay,function(){displayAnchors(obj,true);displayCaption(obj,true);obj.remove()})}else{jQuery(obj).delay(delay).fadeOut(options.transition_speed,function(){displayAnchors(obj,true);displayCaption(obj,true);obj.remove()})}if(options.transition==='hslide'){obj2.css('left','-'+options.content_width+'px');jQuery(obj2).delay(delay).animate({left:lrpos},options.transition_speed,function(){displayAnchors(obj2);displayCaption(obj2);afterAnimation(obj2)})}else if(options.transition==='vslide'){obj2.css('top','-'+showcase.height()+'px');jQuery(obj2).delay(delay).animate({top:'0px'},options.transition_speed,function(){displayAnchors(obj2);displayCaption(obj2);afterAnimation(obj2)})}else{obj2.css('left',lrpos);obj2.css('display','none');jQuery(obj2).delay(delay).fadeIn(options.transition_speed,function(){displayAnchors(obj2);displayCaption(obj2);afterAnimation(obj2)})}content_container.append(obj2)}}if(!options.viewline){previous_id=current_id;current_id=id;if(options.thumbnails){if((current_id>previous_id&&direction!=='previous')||direction==='next'){slideThumbnailWrapper('forward',true)}else if(current_id<previous_id||direction==='previous'){slideThumbnailWrapper('backward',true)}}if(options.arrows){jQuery(showcase).find('.showcase-arrow-previous').unbind('click').click(function(){if(myInterval){if(options.stoponclick){pause_loop=true}clearInterval(myInterval)}changeContent((current_id===0)?content_count-1:parseInt(current_id)-1,'previous')});jQuery(showcase).find('.showcase-arrow-next').unbind('click').click(function(){if(myInterval){if(options.stoponclick){pause_loop=true}clearInterval(myInterval)}changeContent((current_id===content_count-1)?0:parseInt(current_id)+1,'next')})}if(options.thumbnails){i=0;showcase.find('.showcase-thumbnail').each(function(){var object=jQuery(this);object.removeClass('active');if(i===current_id){object.addClass('active')}i++})}if(options.show_caption==='show'){jQuery(obj2).find('.showcase-caption').show()}}if(options.buttons){i=0;showcase.find('.showcase-button-wrapper span').each(function(){var object=jQuery(this);object.removeClass('active');if(i===current_id){object.addClass('active')}i++})}if(typeof options.custom_function=='function'){options.custom_function()}}}function afterAnimation(obj){if(options.dynamic_height){content_container.stop(true,true).animate({height:obj.find('.showcase-content').children().height()},200)}animating=false}var thumbnailSlidePosition=0;function slideThumbnailWrapper(direction,check,backwardforward){var doTheSlide=true;var thumbnailHeightOrWidth=getElementHeight(jQuery(thumb_wrapper).find('.showcase-thumbnail'));if(options.thumbnails_direction==='horizontal'){thumbnailHeightOrWidth=getElementWidth(jQuery(thumb_wrapper).find('.showcase-thumbnail'))}var multiplySlidePosition=1;if(options.thumbnails_slidex===0){options.thumbnails_slidex=thumbnailsPerPage}if(check){var thumbnailSlidePositionCopy=thumbnailSlidePosition;var thumbnailsScrolled=0;while(thumbnailSlidePositionCopy<0){if(options.thumbnails_direction==='horizontal'){thumbnailSlidePositionCopy+=getElementWidth(jQuery(thumbnailArray[0]))}else{thumbnailSlidePositionCopy+=getElementHeight(jQuery(thumbnailArray[0]))}thumbnailsScrolled++}var firstVisible=thumbnailsScrolled;var lastVisible=thumbnailsPerPage+thumbnailsScrolled-1;if(current_id>=firstVisible&&current_id<=lastVisible){doTheSlide=false}var distance;if((current_id-lastVisible)>options.thumbnails_slidex){distance=current_id-lastVisible;while(distance>options.thumbnails_slidex){distance-=options.thumbnails_slidex;multiplySlidePosition++}}else if((firstVisible-current_id)>options.thumbnails_slidex){distance=firstVisible-current_id;while(distance>options.thumbnails_slidex){distance-=options.thumbnails_slidex;multiplySlidePosition++}}else{multiplySlidePosition=1}}if(direction==='forward'&&doTheSlide){if(options.thumbnails_direction==='vertical'&&options.content_height<(thumbnailStretch+thumbnailSlidePosition)){thumbnailSlidePosition-=thumbnailHeightOrWidth*(options.thumbnails_slidex*multiplySlidePosition)}else if(options.thumbnails_direction==='horizontal'&&options.content_width<(thumbnailStretch+thumbnailSlidePosition)){thumbnailSlidePosition-=thumbnailHeightOrWidth*(options.thumbnails_slidex*multiplySlidePosition)}else if(current_id===0){if(!backwardforward){thumbnailSlidePosition=0}}if(options.thumbnails_direction==='horizontal'){thumb_wrapper.animate({left:thumbnailSlidePosition},300)}else{thumb_wrapper.animate({top:thumbnailSlidePosition},300)}}else if(doTheSlide){if(thumbnailSlidePosition<0){thumbnailSlidePosition+=thumbnailHeightOrWidth*(options.thumbnails_slidex*multiplySlidePosition)}else if(current_id===content_count-1){if(!backwardforward){thumbnailSlidePosition-=thumbnailHeightOrWidth*(options.thumbnails_slidex*multiplySlidePosition)}}else{thumbnailSlidePosition=0}if(options.thumbnails_direction==='horizontal'){thumb_wrapper.animate({left:thumbnailSlidePosition},300)}else{thumb_wrapper.animate({top:thumbnailSlidePosition},300)}}}function displayCaption(container,fadeOut){var caption=container.find('.showcase-caption');if(!fadeOut){if(options.show_caption==='onload'){caption.fadeIn(300)}else if(options.show_caption==='onhover'){jQuery(container).mouseenter(function(){caption.fadeIn(300)});jQuery(container).mouseleave(function(){caption.stop(true,true).fadeOut(100)})}}else{caption.stop(true,true).fadeOut(300)}}function displayAnchors(container,fadeOut){container.find('.showcase-tooltips a').each(function(){if(!fadeOut){var coords=jQuery(this).attr('coords');coords=coords.split(',');jQuery(this).addClass('showcase-plus-anchor');jQuery(this).css('position','absolute');jQuery(this).css('display','none');jQuery(this).css('width',options.tooltip_icon_width);jQuery(this).css('height',options.tooltip_icon_height);jQuery(this).css('left',parseInt(coords[0])-(parseInt(options.tooltip_icon_width)/2));jQuery(this).css('top',parseInt(coords[1])-(parseInt(options.tooltip_icon_height)/2));var content=jQuery(this).html();jQuery(this).mouseenter(function(){animateTooltip(container,coords[0],coords[1],content)});jQuery(this).mouseleave(function(){animateTooltip(container,coords[0],coords[1],content)});jQuery(this).html('');jQuery(this).fadeIn(300)}else{jQuery(this).stop(true,true).fadeOut(300)}})}var tooltip=null;function animateTooltip(container,x,y,content){if(tooltip===null){tooltip=jQuery(document.createElement('div')).addClass('showcase-tooltip').css('display','none').css('position','absolute').css('max-width',options.tooltip_width).html(content);container.append(tooltip);var tooltip_paddingx=parseInt(tooltip.css('padding-right'))*2+parseInt(tooltip.css('border-right-width'))*2;var tooltip_paddingy=parseInt(tooltip.css('padding-bottom'))*2+parseInt(tooltip.css('border-bottom-width'))*2;lastx=parseInt(x)+tooltip.width()+tooltip_paddingx;lasty=parseInt(y)+tooltip.height()+tooltip_paddingy;if(lastx<options.content_width){tooltip.css('left',parseInt(x)+parseInt(options.tooltip_offsetx))}else{tooltip.css('left',(parseInt(x)-parseInt(options.tooltip_offsetx))-(parseInt(tooltip.width())+parseInt(options.tooltip_offsetx)))}if(lasty<options.content_height){tooltip.css('top',parseInt(y)+parseInt(options.tooltip_offsety))}else{tooltip.css('top',(parseInt(y)-parseInt(options.tooltip_offsety))-(parseInt(tooltip.height())+parseInt(tooltip_paddingy)))}tooltip.fadeIn(400)}else{tooltip.fadeOut(400);tooltip.remove();tooltip=null}}function getElementHeight(el,incHeight,incMargin,incPadding,incBorders){incHeight=typeof(incHeight)!=='undefined'?incHeight:true;incMargin=typeof(incMargin)!=='undefined'?incMargin:true;incPadding=typeof(incPadding)!=='undefined'?incPadding:true;incBorders=typeof(incBorders)!=='undefined'?incBorders:true;var elHeight=(incHeight)?jQuery((el)).height():0;var elMargin=0;if(incMargin){if(jQuery(el).css('margin-left')!=='auto'){elMargin=parseFloat(jQuery(el).css('margin-left'))}if(jQuery(el).css('margin-right')!=='auto'){elMargin+=parseFloat(jQuery(el).css('margin-right'))}}elPadding=0;if(incPadding){if(jQuery(el).css('padding-left')!=='auto'){elPadding=parseFloat(jQuery(el).css('padding-left'))}if(jQuery(el).css('padding-right')!=='auto'){elPadding+=parseFloat(jQuery(el).css('padding-right'))}}elBorder=0;if(incBorders){if(jQuery(el).css('border-left-width')!=='auto'){elBorder=parseFloat(jQuery(el).css('border-left-width'))}if(jQuery(el).css('border-right-width')!=='auto'){elBorder+=parseFloat(jQuery(el).css('border-right-width'))}}elHeight+=elMargin+elPadding+elBorder;return elHeight}function getElementWidth(el,incWidth,incMargin,incPadding,incBorders){incWidth=typeof(incWidth)!=='undefined'?incWidth:true;incMargin=typeof(incMargin)!=='undefined'?incMargin:true;incPadding=typeof(incPadding)!=='undefined'?incPadding:true;incBorders=typeof(incBorders)!=='undefined'?incBorders:true;var elWidth=(incWidth)?jQuery((el)).width():0;var elMargin=0;if(incMargin){if(jQuery(el).css('margin-left')!=='auto'){elMargin=parseFloat(jQuery(el).css('margin-left'))}if(jQuery(el).css('margin-right')!=='auto'){elMargin+=parseFloat(jQuery(el).css('margin-right'))}}elPadding=0;if(incPadding){if(jQuery(el).css('padding-left')!=='auto'){elPadding=parseFloat(jQuery(el).css('padding-left'))}if(jQuery(el).css('padding-right')!=='auto'){elPadding+=parseFloat(jQuery(el).css('padding-right'))}}elBorder=0;if(incBorders){if(jQuery(el).css('border-left-width')!=='auto'){elBorder=parseFloat(jQuery(el).css('border-left-width'))}if(jQuery(el).css('border-right-width')!=='auto'){elBorder+=parseFloat(jQuery(el).css('border-right-width'))}}elWidth+=elMargin+elPadding+elBorder;return elWidth}if(options.mousetrace){var mousetrace=jQuery(document.createElement('div')).css('position','absolute').css('top','0').css('background-color','#fff').css('color','#000').css('padding','3px 5px').css('x-index','30').html('X: 0 Y: 0');showcase.append(mousetrace);var offset=showcase.offset();content_container.mousemove(function(e){mousetrace.html('X: '+(e.pageX-offset.left)+' Y: '+(e.pageY-offset.top))})}$('#awOnePageButton').click(function showInOnePage(){if($('.view-page').is(':visible')){var temp_container=jQuery(document.createElement('div'));temp_container.addClass('showcase-onepage');showcase.before(temp_container);if(myInterval){pause_loop=true;clearInterval(myInterval)}$(this).find('.view-page').hide();$(this).find('.view-slide').show();showcase.hide();$.each(contentArray,function(index,value){obj=getContent(index);obj.css('position','relative');temp_container.append(obj);displayAnchors(obj);displayCaption(obj);if(options.dynamic_height){obj.css('height',obj.find('.showcase-content').children().height())}else{obj.css('height',options.content_height)}});var clear=jQuery(document.createElement('div'));clear.addClass('clear');temp_container.append(clear)}else{$('.showcase-onepage').remove();$(this).find('.view-page').show();$(this).find('.view-slide').hide();showcase.show()}return false});var addedContentArray=[];function updateContentViewlineWidth(){content_viewline_width=0;content_container.children('div').each(function(){content_viewline_width+=$(this).find('.showcase-content').children().width();addedContentArray.push($(this))})}showcase.removeClass('showcase-load')}})(jQuery);



// bxSlider

(function(e){var D={mode:"horizontal",slideSelector:"",infiniteLoop:!1,hideControlOnEnd:!0,speed:500,easing:null,slideMargin:0,startSlide:0,randomStart:!1,captions:!1,ticker:!1,tickerHover:!1,adaptiveHeight:!1,adaptiveHeightSpeed:500,video:!1,useCSS:!0,preloadImages:"visible",responsive:!0,touchEnabled:!0,swipeThreshold:50,oneToOneTouch:!0,preventDefaultSwipeX:!0,preventDefaultSwipeY:!1,pager:!1,pagerType:"full",pagerShortSeparator:" / ",pagerSelector:null,buildPager:null,pagerCustom:null,controls:!0,

nextText:"",prevText:"",nextSelector:null,prevSelector:null,autoControls:!1,startText:"Start",stopText:"Stop",autoControlsCombine:!1,autoControlsSelector:null,auto:!1,pause:4E3,autoStart:!0,autoDirection:"next",autoHover:!1,autoDelay:0,minSlides:1,maxSlides:1,moveSlides:0,slideWidth:0,onSliderLoad:function(){},onSlideBefore:function(){},onSlideAfter:function(){},onSlideNext:function(){},onSlidePrev:function(){}};e.fn.bxSlider=function(p){if(0==this.length)return this;if(1<this.length)return this.each(function(){e(this).bxSlider(p)}),

this;var a={},c=this,t=e(window).width(),u=e(window).height(),v=function(){a.settings=e.extend({},D,p);a.settings.slideWidth=parseInt(a.settings.slideWidth);a.children=c.children(a.settings.slideSelector);a.children.length<a.settings.minSlides&&(a.settings.minSlides=a.children.length);a.children.length<a.settings.maxSlides&&(a.settings.maxSlides=a.children.length);a.settings.randomStart&&(a.settings.startSlide=Math.floor(Math.random()*a.children.length));a.active={index:a.settings.startSlide};a.carousel=

1<a.settings.minSlides||1<a.settings.maxSlides;a.carousel&&(a.settings.preloadImages="all");a.minThreshold=a.settings.minSlides*a.settings.slideWidth+(a.settings.minSlides-1)*a.settings.slideMargin;a.maxThreshold=a.settings.maxSlides*a.settings.slideWidth+(a.settings.maxSlides-1)*a.settings.slideMargin;a.working=!1;a.controls={};a.interval=null;a.animProp="vertical"==a.settings.mode?"top":"left";a.usingCSS=a.settings.useCSS&&"fade"!=a.settings.mode&&function(){var b=document.createElement("div"),

d=["WebkitPerspective","MozPerspective","OPerspective","msPerspective"],c;for(c in d)if(void 0!==b.style[d[c]])return a.cssPrefix=d[c].replace("Perspective","").toLowerCase(),a.animProp="-"+a.cssPrefix+"-transform",!0;return!1}();"vertical"==a.settings.mode&&(a.settings.maxSlides=a.settings.minSlides);c.data("origStyle",c.attr("style"));c.children(a.settings.slideSelector).each(function(){e(this).data("origStyle",e(this).attr("style"))});E()},E=function(){c.wrap('<div class="bx-wrapper"><div class="bx-viewport"></div></div>');

a.viewport=c.parent();a.loader=e('<div class="bx-loading" />');a.viewport.prepend(a.loader);c.css({width:"horizontal"==a.settings.mode?100*a.children.length+215+"%":"auto",position:"relative"});a.usingCSS&&a.settings.easing?c.css("-"+a.cssPrefix+"-transition-timing-function",a.settings.easing):a.settings.easing||(a.settings.easing="swing");k();a.viewport.css({width:"100%",overflow:"hidden",position:"relative"});a.viewport.parent().css({maxWidth:F()});a.settings.pager||a.viewport.parent().css({margin:"0 auto 0px",

padding:"6px 30px"});a.children.css({"float":"horizontal"==a.settings.mode?"left":"none",listStyle:"none",position:"relative"});a.children.css("width",w());"horizontal"==a.settings.mode&&0<a.settings.slideMargin&&a.children.css("marginRight",a.settings.slideMargin);"vertical"==a.settings.mode&&0<a.settings.slideMargin&&a.children.css("marginBottom",a.settings.slideMargin);"fade"==a.settings.mode&&(a.children.css({position:"absolute",zIndex:0,display:"none"}),a.children.eq(a.settings.startSlide).css({zIndex:50,

display:"block"}));a.controls.el=e('<div class="bx-controls" />');a.settings.captions&&G();a.active.last=a.settings.startSlide==g()-1;a.settings.video&&c.fitVids();var b=a.children.eq(a.settings.startSlide);"all"==a.settings.preloadImages&&(b=a.children);a.settings.ticker?a.settings.pager=!1:(a.settings.pager&&(a.settings.pagerCustom?a.pagerEl=e(a.settings.pagerCustom):(a.pagerEl=e('<div class="bx-pager" />'),a.settings.pagerSelector?e(a.settings.pagerSelector).html(a.pagerEl):a.controls.el.addClass("bx-has-pager").append(a.pagerEl),

x()),a.pagerEl.delegate("a","click",H)),a.settings.controls&&(a.controls.next=e('<a class="bx-next" href="">'+a.settings.nextText+"</a>"),a.controls.prev=e('<a class="bx-prev" href="">'+a.settings.prevText+"</a>"),a.controls.next.bind("click",I),a.controls.prev.bind("click",J),a.settings.nextSelector&&e(a.settings.nextSelector).append(a.controls.next),a.settings.prevSelector&&e(a.settings.prevSelector).append(a.controls.prev),a.settings.nextSelector||a.settings.prevSelector||(a.controls.directionEl=

e('<div class="bx-controls-direction" />'),a.controls.directionEl.append(a.controls.prev).append(a.controls.next),a.controls.el.addClass("bx-has-controls-direction").append(a.controls.directionEl))),a.settings.auto&&a.settings.autoControls&&(a.controls.start=e('<div class="bx-controls-auto-item"><a class="bx-start" href="">'+a.settings.startText+"</a></div>"),a.controls.stop=e('<div class="bx-controls-auto-item"><a class="bx-stop" href="">'+a.settings.stopText+"</a></div>"),a.controls.autoEl=e('<div class="bx-controls-auto" />'),

a.controls.autoEl.delegate(".bx-start","click",K),a.controls.autoEl.delegate(".bx-stop","click",L),a.settings.autoControlsCombine?a.controls.autoEl.append(a.controls.start):a.controls.autoEl.append(a.controls.start).append(a.controls.stop),a.settings.autoControlsSelector?e(a.settings.autoControlsSelector).html(a.controls.autoEl):a.controls.el.addClass("bx-has-controls-auto").append(a.controls.autoEl),q(a.settings.autoStart?"stop":"start")),(a.settings.controls||a.settings.autoControls||a.settings.pager)&&

a.viewport.after(a.controls.el));M(b,N)},M=function(a,d){var c=a.find("img, iframe").length;if(0==c)d();else{var f=0;a.find("img, iframe").each(function(){e(this).one("load",function(){++f==c&&d()}).each(function(){this.complete&&e(this).load()})})}},N=function(){if(a.settings.infiniteLoop&&"fade"!=a.settings.mode&&!a.settings.ticker){var b="vertical"==a.settings.mode?a.settings.minSlides:a.settings.maxSlides,d=a.children.slice(0,b).clone().addClass("bx-clone"),b=a.children.slice(-b).clone().addClass("bx-clone");

c.append(d).prepend(b)}a.loader.remove();y();"vertical"==a.settings.mode&&(a.settings.adaptiveHeight=!0);a.viewport.height(n());c.redrawSlider();a.settings.onSliderLoad(a.active.index);a.initialized=!0;a.settings.responsive&&e(window).bind("resize",z);a.settings.auto&&a.settings.autoStart&&O();a.settings.ticker&&P();a.settings.pager&&r(a.settings.startSlide);a.settings.controls&&A();a.settings.touchEnabled&&!a.settings.ticker&&(a.touch={start:{x:0,y:0},end:{x:0,y:0}},a.viewport.bind("touchstart",

Q))},n=function(){var b=0,d=e();if("vertical"==a.settings.mode||a.settings.adaptiveHeight)if(a.carousel){var c=1==a.settings.moveSlides?a.active.index:a.active.index*m(),d=a.children.eq(c);for(i=1;i<=a.settings.maxSlides-1;i++)d=c+i>=a.children.length?d.add(a.children.eq(i-1)):d.add(a.children.eq(c+i))}else d=a.children.eq(a.active.index);else d=a.children;"vertical"==a.settings.mode?(d.each(function(a){b+=e(this).outerHeight()}),0<a.settings.slideMargin&&(b+=a.settings.slideMargin*(a.settings.minSlides-

1))):b=Math.max.apply(Math,d.map(function(){return e(this).outerHeight(!1)}).get());return b},F=function(){var b="100%";0<a.settings.slideWidth&&(b="horizontal"==a.settings.mode?"390px":a.settings.slideWidth);return b},w=function(){var b=a.settings.slideWidth,d=a.viewport.width();0==a.settings.slideWidth||a.settings.slideWidth>d&&!a.carousel||"vertical"==a.settings.mode?b=d:1<a.settings.maxSlides&&"horizontal"==a.settings.mode&&!(d>a.maxThreshold)&&d<a.minThreshold&&(b=(d-a.settings.slideMargin*(a.settings.minSlides-

1))/a.settings.minSlides);return b},k=function(){var b=1;"horizontal"==a.settings.mode&&0<a.settings.slideWidth?a.viewport.width()<a.minThreshold?b=a.settings.minSlides:a.viewport.width()>a.maxThreshold?b=a.settings.maxSlides:(b=a.children.first().width(),b=Math.floor(a.viewport.width()/b)):"vertical"==a.settings.mode&&(b=a.settings.minSlides);return b},g=function(){var b=0;if(0<a.settings.moveSlides)if(a.settings.infiniteLoop)b=a.children.length/m();else for(var d=0,c=0;d<a.children.length;)++b,

d=c+k(),c+=a.settings.moveSlides<=k()?a.settings.moveSlides:k();else b=Math.ceil(a.children.length/k());return b},m=function(){return 0<a.settings.moveSlides&&a.settings.moveSlides<=k()?a.settings.moveSlides:k()},y=function(){if(a.children.length>a.settings.maxSlides&&a.active.last&&!a.settings.infiniteLoop)if("horizontal"==a.settings.mode){var b=a.children.last(),d=b.position();h(-(d.left-(a.viewport.width()-b.width())),"reset",0)}else"vertical"==a.settings.mode&&(d=a.children.eq(a.children.length-

a.settings.minSlides).position(),h(-d.top,"reset",0));else d=a.children.eq(a.active.index*m()).position(),a.active.index==g()-1&&(a.active.last=!0),void 0!=d&&("horizontal"==a.settings.mode?h(-d.left,"reset",0):"vertical"==a.settings.mode&&h(-d.top,"reset",0))},h=function(b,d,e,f){if(a.usingCSS)b="vertical"==a.settings.mode?"translate3d(0, "+b+"px, 0)":"translate3d("+b+"px, 0, 0)",c.css("-"+a.cssPrefix+"-transition-duration",e/1E3+"s"),"slide"==d?(c.css(a.animProp,b),c.bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",

function(){c.unbind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd");s()})):"reset"==d?c.css(a.animProp,b):"ticker"==d&&(c.css("-"+a.cssPrefix+"-transition-timing-function","linear"),c.css(a.animProp,b),c.bind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd",function(){c.unbind("transitionend webkitTransitionEnd oTransitionEnd MSTransitionEnd");h(f.resetValue,"reset",0);l()}));else{var g={};g[a.animProp]=b;"slide"==d?c.animate(g,e,a.settings.easing,function(){s()}):

"reset"==d?c.css(a.animProp,b):"ticker"==d&&c.animate(g,speed,"linear",function(){h(f.resetValue,"reset",0);l()})}},x=function(){for(var b="",d=g(),c=0;c<d;c++){var f="";a.settings.buildPager&&e.isFunction(a.settings.buildPager)?(f=a.settings.buildPager(c),a.pagerEl.addClass("bx-custom-pager")):(f=c+1,a.pagerEl.addClass("bx-default-pager"));b+='<div class="bx-pager-item"><a href="" data-slide-index="'+c+'" class="bx-pager-link">'+f+"</a></div>"}a.pagerEl.html(b)},G=function(){a.children.each(function(a){a=

e(this).find("img:first").attr("title");void 0!=a&&(""+a).length&&e(this).append('<div class="bx-caption"><span>'+a+"</span></div>")})},I=function(b){a.settings.auto&&c.stopAuto();c.goToNextSlide();b.preventDefault()},J=function(b){a.settings.auto&&c.stopAuto();c.goToPrevSlide();b.preventDefault()},K=function(a){c.startAuto();a.preventDefault()},L=function(a){c.stopAuto();a.preventDefault()},H=function(b){a.settings.auto&&c.stopAuto();var d=e(b.currentTarget),d=parseInt(d.attr("data-slide-index"));

d!=a.active.index&&c.goToSlide(d);b.preventDefault()},r=function(b){var c=a.children.length;"short"==a.settings.pagerType?(1<a.settings.maxSlides&&(c=Math.ceil(a.children.length/a.settings.maxSlides)),a.pagerEl.html(b+1+a.settings.pagerShortSeparator+c)):(a.pagerEl.find("a").removeClass("active"),a.pagerEl.each(function(a,c){e(c).find("a").eq(b).addClass("active")}))},s=function(){if(a.settings.infiniteLoop){var b="";0==a.active.index?b=a.children.eq(0).position():a.active.index==g()-1&&a.carousel?

b=a.children.eq((g()-1)*m()).position():a.active.index==a.children.length-1&&(b=a.children.eq(a.children.length-1).position());"horizontal"==a.settings.mode?h(-b.left,"reset",0):"vertical"==a.settings.mode&&h(-b.top,"reset",0)}a.working=!1;a.settings.onSlideAfter(a.children.eq(a.active.index),a.oldIndex,a.active.index)},q=function(b){a.settings.autoControlsCombine?a.controls.autoEl.html(a.controls[b]):(a.controls.autoEl.find("a").removeClass("active"),a.controls.autoEl.find("a:not(.bx-"+b+")").addClass("active"))},

A=function(){1==g()?(a.controls.prev.addClass("disabled"),a.controls.next.addClass("disabled")):!a.settings.infiniteLoop&&a.settings.hideControlOnEnd&&(0==a.active.index?(a.controls.prev.addClass("disabled"),a.controls.next.removeClass("disabled")):a.active.index==g()-1?(a.controls.next.addClass("disabled"),a.controls.prev.removeClass("disabled")):(a.controls.prev.removeClass("disabled"),a.controls.next.removeClass("disabled")))},O=function(){0<a.settings.autoDelay?setTimeout(c.startAuto,a.settings.autoDelay):

c.startAuto();a.settings.autoHover&&c.hover(function(){a.interval&&(c.stopAuto(!0),a.autoPaused=!0)},function(){a.autoPaused&&(c.startAuto(!0),a.autoPaused=null)})},P=function(){var b=0;"next"==a.settings.autoDirection?c.append(a.children.clone().addClass("bx-clone")):(c.prepend(a.children.clone().addClass("bx-clone")),b=a.children.first().position(),b="horizontal"==a.settings.mode?-b.left:-b.top);h(b,"reset",0);a.settings.pager=!1;a.settings.controls=!1;a.settings.autoControls=!1;a.settings.tickerHover&&

!a.usingCSS&&a.viewport.hover(function(){c.stop()},function(){var b=0;a.children.each(function(c){b+="horizontal"==a.settings.mode?e(this).outerWidth(!0):e(this).outerHeight(!0)});var g=a.settings.speed/b*(b-Math.abs(parseInt(c.css("horizontal"==a.settings.mode?"left":"top"))));l(g)});l()},l=function(b){speed=b?b:a.settings.speed;b={left:0,top:0};var d={left:0,top:0};"next"==a.settings.autoDirection?b=c.find(".bx-clone").first().position():d=a.children.first().position();h("horizontal"==a.settings.mode?

-b.left:-b.top,"ticker",speed,{resetValue:"horizontal"==a.settings.mode?-d.left:-d.top})},Q=function(b){a.working?b.preventDefault():(a.touch.originalPos=c.position(),b=b.originalEvent,a.touch.start.x=b.changedTouches[0].pageX,a.touch.start.y=b.changedTouches[0].pageY,a.viewport.bind("touchmove",B),a.viewport.bind("touchend",C))},B=function(b){var c=b.originalEvent,e=Math.abs(c.changedTouches[0].pageX-a.touch.start.x),f=Math.abs(c.changedTouches[0].pageY-a.touch.start.y);3*e>f&&a.settings.preventDefaultSwipeX?

b.preventDefault():3*f>e&&a.settings.preventDefaultSwipeY&&b.preventDefault();"fade"!=a.settings.mode&&a.settings.oneToOneTouch&&(b=0,"horizontal"==a.settings.mode?(c=c.changedTouches[0].pageX-a.touch.start.x,b=a.touch.originalPos.left+c):(c=c.changedTouches[0].pageY-a.touch.start.y,b=a.touch.originalPos.top+c),h(b,"reset",0))},C=function(b){a.viewport.unbind("touchmove",B);var d=b.originalEvent;b=0;a.touch.end.x=d.changedTouches[0].pageX;a.touch.end.y=d.changedTouches[0].pageY;"fade"==a.settings.mode?

(d=Math.abs(a.touch.start.x-a.touch.end.x),d>=a.settings.swipeThreshold&&(a.touch.start.x>a.touch.end.x?c.goToNextSlide():c.goToPrevSlide(),c.stopAuto())):("horizontal"==a.settings.mode?(d=a.touch.end.x-a.touch.start.x,b=a.touch.originalPos.left):(d=a.touch.end.y-a.touch.start.y,b=a.touch.originalPos.top),!a.settings.infiniteLoop&&(0==a.active.index&&0<d||a.active.last&&0>d)?h(b,"reset",200):Math.abs(d)>=a.settings.swipeThreshold?(0>d?c.goToNextSlide():c.goToPrevSlide(),c.stopAuto()):h(b,"reset",

200));a.viewport.unbind("touchend",C)},z=function(a){a=e(window).width();var d=e(window).height();if(t!=a||u!=d)t=a,u=d,c.redrawSlider()};c.goToSlide=function(b,d){if(!a.working&&a.active.index!=b){a.working=!0;a.oldIndex=a.active.index;0>b?a.active.index=g()-1:b>=g()?a.active.index=0:a.active.index=b;a.settings.onSlideBefore(a.children.eq(a.active.index),a.oldIndex,a.active.index);if("next"==d)a.settings.onSlideNext(a.children.eq(a.active.index),a.oldIndex,a.active.index);else if("prev"==d)a.settings.onSlidePrev(a.children.eq(a.active.index),

a.oldIndex,a.active.index);a.active.last=a.active.index>=g()-1;a.settings.pager&&r(a.active.index);a.settings.controls&&A();if("fade"==a.settings.mode)a.settings.adaptiveHeight&&a.viewport.height()!=n()&&a.viewport.animate({height:n()},a.settings.adaptiveHeightSpeed),a.children.filter(":visible").fadeOut(a.settings.speed).css({zIndex:0}),a.children.eq(a.active.index).css("zIndex",51).fadeIn(a.settings.speed,function(){e(this).css("zIndex",50);s()});else{a.settings.adaptiveHeight&&a.viewport.height()!=

n()&&a.viewport.animate({height:n()},a.settings.adaptiveHeightSpeed);var k=0,f={left:0,top:0};if(!a.settings.infiniteLoop&&a.carousel&&a.active.last)if("horizontal"==a.settings.mode)var l=a.children.eq(a.children.length-1),f=l.position(),k=a.viewport.width()-l.outerWidth();else f=a.children.eq(a.children.length-a.settings.minSlides).position();else a.carousel&&a.active.last&&"prev"==d?(f=1==a.settings.moveSlides?a.settings.maxSlides-m():(g()-1)*m()-(a.children.length-a.settings.maxSlides),l=c.children(".bx-clone").eq(f),

f=l.position()):"next"==d&&0==a.active.index?(f=c.find("> .bx-clone").eq(a.settings.maxSlides).position(),a.active.last=!1):0<=b&&(f=b*m(),f=a.children.eq(f).position());"undefined"!==typeof f&&h("horizontal"==a.settings.mode?-(f.left-k):-f.top,"slide",a.settings.speed)}}};c.goToNextSlide=function(){if(a.settings.infiniteLoop||!a.active.last){var b=parseInt(a.active.index)+1;c.goToSlide(b,"next")}};c.goToPrevSlide=function(){if(a.settings.infiniteLoop||0!=a.active.index){var b=parseInt(a.active.index)-

1;c.goToSlide(b,"prev")}};c.startAuto=function(b){a.interval||(a.interval=setInterval(function(){"next"==a.settings.autoDirection?c.goToNextSlide():c.goToPrevSlide()},a.settings.pause),a.settings.autoControls&&!0!=b&&q("stop"))};c.stopAuto=function(b){a.interval&&(clearInterval(a.interval),a.interval=null,a.settings.autoControls&&!0!=b&&q("start"))};c.getCurrentSlide=function(){return a.active.index};c.getSlideCount=function(){return a.children.length};c.redrawSlider=function(){a.children.add(c.find(".bx-clone")).outerWidth(w());

a.viewport.css("height",n());a.settings.ticker||y();a.active.last&&(a.active.index=g()-1);a.active.index>=g()&&(a.active.last=!0);a.settings.pager&&!a.settings.pagerCustom&&(x(),r(a.active.index))};c.destroySlider=function(){a.initialized&&(a.initialized=!1,e(".bx-clone",this).remove(),a.children.each(function(){void 0!=e(this).data("origStyle")?e(this).attr("style",e(this).data("origStyle")):e(this).removeAttr("style")}),void 0!=e(this).data("origStyle")?this.attr("style",e(this).data("origStyle")):

e(this).removeAttr("style"),e(this).unwrap().unwrap(),a.controls.el&&a.controls.el.remove(),a.controls.next&&a.controls.next.remove(),a.controls.prev&&a.controls.prev.remove(),a.pagerEl&&a.pagerEl.remove(),e(".bx-caption",this).remove(),a.controls.autoEl&&a.controls.autoEl.remove(),clearInterval(a.interval),a.settings.responsive&&e(window).unbind("resize",z))};c.reloadSlider=function(a){void 0!=a&&(p=a);c.destroySlider();v()};v();return this}})(jQuery);